{extend name="../../admin/view/public/admin"}

{block name='content'}


<style>
    .multi-item {
        margin-bottom: 18px;
    }
</style>

<div class="page-header">
    当前位置：<span class="text-primary">{if !empty($item)}编辑{else}新建{/if}授权码
    	<small>{if !empty($item)}(名称: {$item['company']}){/if}</small>
    </span>
</div>

<div class="page-content">

    <form action="" method="post" class="form-validate form-horizontal ">
        <input type="hidden" name="id" value="{$item['id']}"/>

        <div class="form-group-title">授权码信息</div>

        <div class="form-group">
            <label class="col-lg control-label">授权类型</label>
            <div class="col-sm-9 col-xs-12">
                <label class="radio-inline">
                    <input type="radio" name="type" value="1" {if $item['type']==1 || empty($item)}checked="checked"{/if} {if $item['code']}disabled{/if}> 商户
                </label>
                <label class="radio-inline">
                    <input type="radio" name="type" value="0" {if isset($item['type']) && $item['type']==0}checked="checked"{/if} {if $item['code']}disabled{/if}> 用户
                </label>
            </div>
        </div>

        {if $item['code']}
        <div class="form-group">
            <label class="col-lg-1 control-label">授权码</label>
            <div class="col-sm-9 col-xs-12">
                <div class="form-control-static js-clip" data-url="{$item['code']}">{$item['code']}</div>
            </div>
        </div>
        {/if}

        <div class="form-group">
            <label class="col-lg control-label must">截止时间</label>
            <div class="col-sm-9 col-xs-12">
                {:tpl_form_field_date('end_time',$item['end_time'],true)}
            </div>
        </div>

        <div class="form-group">
            <label class="col-lg control-label"></label>
            <div class="col-sm-9">
                <input type="submit" class="btn btn-primary" value="保存">
                <a class="btn btn-default" href="{:webUrl('sysset/code')}">返回列表</a>
            </div>
        </div>

    </form>
</div>

{/block}